-
Notifications
You must be signed in to change notification settings - Fork 7
Add default_folder config setting #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Set the default folder in config.ini with the key `default_folder`. For e.g. `default_folder = games`. Cubiboot will start with that folder open instead of in the root of the SD card.
cubeboot/source/main.c
Outdated
| // } | ||
| void *default_folder_ptr = (void*)get_symbol_value(symshdr, syment, symstringdata, "default_folder"); | ||
| if (default_folder_ptr != NULL && settings.default_folder != NULL) { | ||
| iprintf("Copying cube_logo_path: %p\n", default_folder_ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update print string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
patches/source/main.c
Outdated
|
|
||
| if (!start_passthrough_game) { | ||
| gm_start_thread("/"); | ||
| if (dvd_custom_open(default_folder, FILE_ENTRY_TYPE_DIR, 0) == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an uninitialized string without checking if it is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorted this and refactored the whole thing whilst doing it because I wasn't liking the nested if statements. I'm rubbish at naming functions and variables.
|
I realised that if you didn't use a |
- Added get_valid_path() helper to safely check default_folder. - Handles NULL, empty, and missing leading '/' cases. - Falls back to root '/' if folder does not exist.
49095ea to
cc276ea
Compare
- Renamed get_valid_path() to resolve_default_folder() for clarity - Switched to using a local path_buf to safely build folder paths - Moved default_folder initialisation to below cube_logo
|
Didn't mean to do that |
Set the default folder in config.ini with the key
default_folder.Example:
default_folder = gamesCubiboot will start with that folder open instead of in the root of the SD card.
I tested the cubiboot.dol on a GameCube with picoboot v0.5.0.
All of these opened the games folder on boot correctly:
Setting default_folder to a directory that doesn't exist will just open the root of the SD like normal.